package org.example.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.example.entity.FM;
import org.example.mapper.FMMapper;
import org.example.service.FMService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName FMServiceImpl
 * @Description TODO
 * @Author lipeijin
 * @Date 2025年08月14日 下午8:48
 * @Version 1.0
 */
@Service
public class FMServiceImpl implements FMService {
    @Autowired
    private FMMapper fmMapper;
    @Override
    public PageInfo<FM> getPage(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<FM> fms = fmMapper.getPage();
        PageInfo<FM> pageInfo = new PageInfo<>(fms);
        return pageInfo;
    }

    @Override
    public PageInfo<FM> getPageMore(String tag, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<FM> fms = fmMapper.getPageMore(tag);
        PageInfo<FM> pageInfo = new PageInfo<>(fms);
        return pageInfo;
    }
}
